import UnitSpellEvent from '@/event/UnitSpellEvent';
import MathUtil from '@/MathUtil';
import RandomUtil from '@/RandomUtil';
import SummonCommon from 'code/Core/Common/SummonCommon';
import UnitCommon from 'code/Core/Common/UnitCommon';
import VestCommon from 'code/Core/Common/VestCommon';
export default class Item_骷髅之杖 {
    static id = 'Aklz';
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        x = GetUnitX(来源);
        y = GetUnitY(来源);
        let fp = UnitCommon.getFullProperty(来源);
        let life = 150 + (10 * fp) / 3;
        let atk = 15 + fp / 3;
        let armor = 15 + fp / 6;
        let res = 15 + fp / 6;
        for (let i = 0; i < 2; i++) {
            let { x: tx, y: ty } = MathUtil.polarProjection(x, y, RandomUtil.nextInt(100, 300), RandomUtil.randomAngle());
            SummonCommon.summon({
                caster: 来源,
                unitTypeId: 'nske',
                x: tx,
                y: ty,
                lifeTime: 30,
                attr: {
                    life: life,
                    attack: atk,
                    附加护甲: armor,
                    附加魔抗: res,
                },
            });
        }
        for (let i = 0; i < 2; i++) {
            let { x: tx, y: ty } = MathUtil.polarProjection(x, y, RandomUtil.nextInt(100, 300), RandomUtil.randomAngle());
            SummonCommon.summon({
                caster: 来源,
                unitTypeId: 'nsca',
                x: tx,
                y: ty,
                lifeTime: 30,
                attr: {
                    life: life * 0.8,
                    attack: atk * 1.5,
                    附加护甲: armor * 0.8,
                    附加魔抗: res * 0.8,
                },
            });
        }
    }
    constructor() {
        se.onUnitSpellEffect(Item_骷髅之杖.spellEffect, Item_骷髅之杖.id);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_骷髅之杖.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
